<template>
  <uni-popup ref="popup" type="center" :mask-click="false">
    <view class="achievement-notify">
      <view class="header">
        <uni-icons type="checkmarkempty" color="#4cd964" size="24"></uni-icons>
        <text>成就解锁</text>
      </view>
      <view class="content">
        <text class="title">{{achievement.description}}</text>
        <text class="desc">{{achievement.detail}}</text>
      </view>
      <view class="footer">
        <button @click="close">确定</button>
      </view>
    </view>
  </uni-popup>
</template>

<script>
export default {
  props: {
    achievement: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    show() {
      this.$refs.popup.open()
    },
    close() {
      this.$refs.popup.close()
    }
  }
}
</script>

<style scoped>
.achievement-notify {
  width: 600rpx;
  background: #fff;
  border-radius: 20rpx;
  overflow: hidden;
}

.header {
  display: flex;
  align-items: center;
  padding: 30rpx;
  background: #f8fff8;
  border-bottom: 1rpx solid #eee;
}

.header text {
  margin-left: 20rpx;
  font-size: 32rpx;
  font-weight: bold;
  color: #4cd964;
}

.content {
  padding: 30rpx;
}

.title {
  display: block;
  font-size: 36rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
  color: #333;
}

.desc {
  display: block;
  font-size: 28rpx;
  color: #666;
}

.footer {
  padding: 20rpx;
  text-align: center;
  border-top: 1rpx solid #eee;
}

button {
  width: 200rpx;
  height: 70rpx;
  line-height: 70rpx;
  font-size: 28rpx;
  background: #007aff;
  color: #fff;
  border-radius: 35rpx;
}
</style>
